package com.project.livetv.adapter;

import android.content.res.ColorStateList;
import android.graphics.Color;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.project.livetv.R;

import java.util.List;

/**
 * Created by li on 2016/5/9.
 */
public class MyFragmentPageAdapter extends FragmentPagerAdapter {
    private List<Fragment> fragments;
    private View view;
    public MyFragmentPageAdapter(FragmentManager fm,List<Fragment> fragments,View view) {
        super(fm);
        this.fragments=fragments;
        this.view=view;
    }

    @Override
    public Fragment getItem(int position) {

        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments==null?0:fragments.size();
    }
}
